package cz.incad.psh.psh_solr;

/**
 *
 * @author Alberto Hernandez
 */
public class ProgramArguments {

    public String solr = null;
    public String rdf = null;
    public String xsl = null;
    public boolean clear = false;

    public ProgramArguments() {
    }

    public Boolean parse(String[] args) {
        try {
            int total = args.length;
            int i = 0;
            while (i < total) {
                if (args[i].equalsIgnoreCase("-solr")) {
                    i++;
                    solr = args[i];
                } else if (args[i].equalsIgnoreCase("-clear")) {
                    clear = true;
                } else if (args[i].equalsIgnoreCase("-rdf")) {
                    i++;
                    rdf = args[i];
                } else if (args[i].equalsIgnoreCase("-xsl")) {
                    i++;
                    xsl = args[i];
                } 

                i++;
            }
            return true;
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
    }
}
